package org.i_plus.controller;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class LogoutServlet extends HttpServlet {

	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse res)
			throws ServletException, IOException {
		req.getSession().removeAttribute("user");
		req.getSession().removeAttribute("userpic");
		
//		Cookie cookie1 = new Cookie("user", null);
//		cookie1.setMaxAge(0);
//		Cookie cookie2 = new Cookie("userpic", null);
//		cookie2.setMaxAge(0);
//		res.addCookie(cookie1);
//		res.addCookie(cookie2);
		
		req.getRequestDispatcher("/index.jsp").forward(req, res);
		return;
	}
}
